package com.itheima.args;



import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Demo02 {
    public static void main(String[] args) {

        //创建list不可变集合
//        List<String> list = List.of("张三", "李四", "王五", "赵六");
//        System.out.println(list.get(0));
//        System.out.println(list.get(1));
//        System.out.println(list.get(2));
//        System.out.println(list.get(3));
//
//        System.out.println(list);

        //创建set不变的集合
        //Set<String> set = Set.of( "张三", "李四", "王五", "赵六");
        //System.out.println(set);

        //不可变的map集合
        HashMap<String, String> hm = new HashMap<>();
        hm.put("张三", "南京");
        hm.put("李四", "北京");
        hm.put("王五", "上海");
        hm.put("赵六", "北京");
        hm.put("孙七", "深圳");
        hm.put("周八", "杭州");
        hm.put("吴九", "宁波");
        hm.put("郑十", "苏州");
        hm.put("刘一", "无锡");
        hm.put("陈二", "嘉兴");
        hm.put("aaa", "111");

        //jdk10以上
        Map<String, String> aaa = Map.copyOf(hm);
        //aaa.put("vvv","222");
        System.out.println(aaa);
    }
}
